package com.wenyu.wenyuyuedu.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;

import com.wenyu.wenyuyuedu.R;
import com.wenyu.wenyuyuedu.utils.AbSharedUtil;
import com.wenyu.wenyuyuedu.utils.SharedConstants;

/*
* 闪屏页
* */
public class SplshActivity extends AppCompatActivity {

    private String denglu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //去掉状态栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        denglu = AbSharedUtil.getString(SplshActivity.this, SharedConstants.DENGLU);
        setContentView(R.layout.activity_splsh);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if(denglu == null){
                    Intent intent = new Intent(SplshActivity.this,GuideActivity.class);
                    startActivity(intent);
                    SplshActivity.this.finish();
                }else{
                    Intent intent = new Intent(SplshActivity.this,MainActivity.class);
                    startActivity(intent);
                    SplshActivity.this.finish();
                }
            }
        },2000);
    }
}
